Mahbubul Majumder, PhD
Feb 14, 2017
there are three cones that help perceiving different segment of light
in statistical graphics colors are mapped to some variables
Human eye has
Cone captures color
Rod captures brightness
Brain processes them and we finally perceive
Picture Source: http://jfly.iam.u-tokyo.ac.jp/color/
cols <- rgb(r=c(1,0,0), g=c(0,1,0), b=c(0,0,1))
df <- data.frame(x=1:3, y=1)
ggplot(df, aes(x,y)) + geom_bar(fill=cols, stat="identity")
Panels are faceted by color blue
problem with RGB
Our perception of color can be directly controlled by
cols <- hcl(h=c(0,120,240), c=c(90,90,90), l=c(60,60,60))
df <- data.frame(x=1:3, y=1)
ggplot(df, aes(x,y)) + geom_bar(fill=cols, stat="identity")
cols <- hsv(h=c(0,0.33,0.66), s=c(0.9,0.9,0.9), v=c(0.6,0.6,0.6))
df <- data.frame(x=1:3, y=1)
ggplot(df, aes(x,y)) + geom_bar(fill=cols, stat="identity")
Which of these three colors looks more important or emphasized?
Which of these three colors looks more important or emphasized?
To pick color, choose hue in equal distence
Example : suppose we want to pick 4 colors
These colors will be equally distent and emphesized
This is how ggplot2 picks default color
hcl(h=c(0,120,240), c=90, l=60)
[1] "#E96485" "#45A500" "#009BE8"
pie(rep(1, 12), col = rainbow(12))
HCL-Based Color Palettes in R
http://cran.r-project.org/web/packages/colorspace/vignettes/hcl-colors.pdf
Color Design for the Color Vision Impaired by Bernhard Jenny and Nathaniel Vaughn Kelso
http://colororacle.org/resources/2007_JennyKelso_DesigningMapsForTheColourVisionImpaired.pdf
Expert Color Choices for Presenting Data by Maureen Stone, StoneSoup Consulting
http://www.stonesc.com/pubs/Expert%20Color%20Choices.pdf